package com.sx.pipeline.ui.needs.operator.list

import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
import androidx.lifecycle.Lifecycle
import androidx.viewpager2.adapter.FragmentStateAdapter
import com.sx.pipeline.ui.needs.operator.list.frag.OperatorNeedsFragment

/**
 * @Author: YY
 * @Date: 2022/4/13
 * @Description: 任务
 */
class OperatorNeedsPageAdapter(
    private val tabs: List<String>,
    private val tabsId: List<Int>,
    fm: FragmentManager, lifecycle: Lifecycle,
) : FragmentStateAdapter(fm, lifecycle) {

    override fun getItemCount(): Int {
        return tabs.size
    }

    override fun createFragment(position: Int): Fragment {
        return OperatorNeedsFragment.newInstance(tabsId[position])
    }
}